<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/11/15
  Time: 8:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <title>欢迎注册新鲜e客_新鲜e客（pinnong.com）-通州区网购首选-正品低价、品质保障、配送及时、轻松购物</title>
    <css><link rel="stylesheet" type="text/css" href="assets/css/pc/register.css"/></css>
    <js><script type="text/javascript" src="assets/js/pc/register.js"></script></js>
    <script type="text/javascript">
        $(function() {
            $('#imgCode').click(function() {
                $(this).attr('src','imgCode.jpg?' + Math.floor(Math.random() * 100));
            });
        });
    </script>


<!-- 导航条 S -->
<div class="header">
    <div class="container">
        <div class="pull-left text-left">
            <a href="#"><img src="assets/img/pc/logo.png" width="165px" border="0"/></a>
        </div>
    </div>
</div>
<!-- 导航条 E -->


<div class="main green-bg">
    <div class="container row">
        <div class="col-sm-6 pull-left">
            <img src="assets/img/pc/zs_register.png"/>
        </div>

        <div class="col-sm-6 pull-right regisiter-con">
            <div class="title">注册账号</div>
            <form class="form-horizontal regisit-wrap-inner" method="post" id="registerForm" onsubmit="return true;" action="eshopServlet/register">

                <div class="form-group">
                    <div class="col-xs-12 errorTip">
                        ${ERROR}
                        ${MC}
                        ${MSG}
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-xs-12">
                        <div class="input-group">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-phone"></span></span>
                            <input id="username" type="text" name="username" class="form-control input-lg" placeholder="手机号" maxlength="11"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12">
                        <div class="input-group">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                            <input id="password" type="password" name="password" minlength="6" maxlength="20" class="form-control input-lg" placeholder="设置6-20位密码">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12">
                        <div class="input-group">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                            <input id="rqpwd" type="password" name="rqpwd" class="form-control input-lg" minlength="6" maxlength="20" equalto="#password" placeholder="确认密码"/>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-xs-12">
                        <div class="input-group">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-text-width"></span></span>
                            <input style="width: 180px" type="text" id="identitycode" name="imgcode" class="form-control input-lg" placeholder="图片验证码" maxlength="6"/>
                            <a style="width: 123px" data-disabled="0" href="javascript:void(0);"  class="input-group-addon btnSendMessage">
                                <img title = "点我换一张" alt="" src="imgCode.jpg" id="imgCode" style="cursor:pointer;">
                            </a>
                        </div>
                    </div>
                </div>



                <div class="form-group">
                    <div class="col-xs-12">
                        <div class="input-group">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-text-width"></span></span>
                            <input type="text" id="dxyzm" name="dxyzm" class="form-control input-lg" placeholder="短信验证码" maxlength="6"/>
                            <a data-disabled="0" href="#" id="msgCode" class="input-group-addon btnSendMessage">获取短信验证码</a>
                        </div>
                            <%--将手机号通过ajax传给servlet--%>
                            <script>
                                $(function(){
                                    $("#msgCode").click(function(){
                                        var phone=$("#username").val();
                                        $.ajax({
                                            url:"eshopServlet/getMessageCode",
                                            type:"post",
                                            data:{"phone":phone},
                                            dataType:"json",
                                        }).done(function(res){
                                            alert("验证码发送成功");
                                        });
                                        return false;
                                    });
                                });

                            </script>

                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-12 text-left">
                        <div class="checkbox checked">
                            <label>
                                <input id="ctchk" type="checkbox" checked="">我已阅读并同意《用户注册协议》
                                <a href="members/login" style="position: relative;left: 85px;">立即登录</a>
                            </label>
                        </div>
                    </div>
                </div>
                <div class="space"></div>
                <div class="form-group">
                    <div class="col-xs-12">
                        <button type="submit" class="col-xs-12 btn btn-success btn-lg registerBtn">立即注册</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>



